home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / debug / TRSaferPtch.readme < prev   
Encoding:
Text File  |  1997-09-05  |  9.1 KB  |  267 lines

  1. Short:    Safer Setfunctions Debug Tools
  2. Author:   thor@math.tu-berlin.de (Thomas Richter)
  3. Uploader: thor@math.tu-berlin.de (Thomas Richter)
  4. Type:     dev/debug
  5.  
  6. _____________________________________________________________________________
  7.  
  8.                         The THOR-Software Licence
  9.  
  10.  
  11. This License applies to the computer programs known as "SaferPatches" and 
  12. "ShowPatch". The "Program", below, refers to such program.
  13.  
  14.  
  15. The programs and files in this distribution are freely distributable
  16. under the restrictions stated below, but are also Copyright (c)
  17. Thomas Richter.
  18.  
  19.  
  20. Distribution of the Program by a commercial organization without written
  21. permission from the author to any third party is prohibited if any payment
  22. is made in connection with such distribution, whether directly
  23. (as in payment for a copy of the Program) or indirectly (as in payment
  24. for some service related to the Program, or payment for some product
  25. or service that includes a copy of the Program "without charge";
  26. these are only examples, and not an exhaustive enumeration of prohibited
  27. activities). However, the following methods of distribution involving
  28. payment shall not in and of themselves be a violation of this restriction:
  29.  
  30.  
  31. (i) Posting the Program on a public access information storage and
  32. retrieval service for which a fee is received for retrieving information
  33. (such as an on-line service), provided that the fee is not
  34. content-dependent (i.e., the fee would be the same for retrieving the same
  35. volume of information consisting of random data).
  36.  
  37.  
  38.  
  39. (ii) Distributing the Program on a CD-ROM, provided that the files
  40. containing the Program are reproduced entirely and verbatim on such
  41. CD-ROM, and provided further that all information on such CD-ROM be
  42. redistributable for non-commercial purposes without charge.
  43.  
  44.  
  45.  
  46. Everything in this distribution must be kept together, in original
  47. and unmodified form.
  48.  
  49.  
  50.  
  51.  
  52. Limitations.
  53.  
  54. THE PROGRAM IS PROVIDED TO YOU "AS IS," WITHOUT WARRANTY. THERE IS NO
  55. WARRANTY FOR THE PROGRAM, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
  56. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
  57. PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE
  58. RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD
  59. THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
  60. SERVICING, REPAIR OR CORRECTION.
  61.  
  62.  
  63.  
  64. IF YOU DO NOT ACCEPT THIS LICENCE, YOU MUST DELETE ALL FILES CONTAINED IN
  65. THIS ARCHIVE.
  66.  
  67. _____________________________________________________________________________
  68.  
  69.  
  70. Purpose of this program:
  71.  
  72.     Make the SetFunction (= patch function) of the OS safer, allow 
  73.     installation and removal of patches in any order.
  74.     Record the patches made and the program that made the patch.
  75.  
  76. This program is mainly intended as a debugging tool, for recording the patches
  77. installed and to capture illegal patches. It is, however, adviced to run with
  78. SaferPatches installed permanently.
  79.  
  80. SaferPatches will free the additional memory occupied by the patched functions
  81. automatically if a library is flushed later on.
  82.  
  83.  
  84.     SYNOPSIS:
  85.  
  86. SaferPatches    INSTALL    REMOVE    REMEMBER
  87.  
  88.  
  89. INSTALL        Add the "SaferPatches" patch to the system.
  90. REMOVE        Remove "SaferPatches" from the system. You are, however,
  91.         "recommanded" not to remove it once you've started it.
  92.         
  93. REMEMBER    This option can be given together with INSTALL. If present,
  94.         SaferPatches will store the names of the programs together
  95.         with the patch they added.
  96.  
  97.  
  98.     SYNOPSIS:
  99.  
  100. ShowPatch    fd_dir
  101.  
  102.     Shows all patches added to the system, together with the entry point
  103.     and the program that added the patch, if available - see the
  104.     REMEMBER option of the Saferpatches program.
  105.  
  106.     If the "fd_dir" is given, ShowPatch will read standard ".fd"
  107.     library descriptions from that subdirectory and will present the
  108.     name of the entry point that has been patched as well.
  109.  
  110.  
  111. _____________________________________________________________________________
  112.  
  113. Compatibility:
  114.  
  115.     "SaferPatches" is NOT compatible to the following illegal patches:
  116. (see below for what is considered to be legal)
  117.  
  118.     -CEDPatch
  119.  
  120.  
  121.  
  122. The way "SaferPatches" operates conflicts with my debug utility "MemSniff".
  123. If you want to run both, "MemSniff" and "SaferPatches", you should add the
  124. command line option "SNIFF" to SaferPatches. You shouldn't provide that
  125. option in other situations.
  126.  
  127.  
  128. VirusZ might report that libraries got patched from time to time. This is
  129. because SaferPatches modifies the Expunge vector of all libraries in order
  130. to free the memory occupied by the patches if the library gets closed. This
  131. warning message is harmless.
  132.  
  133.  
  134. IMPORTANT:    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  135. Saferpatches MUST be run BEHIND SetPatch !!!!!!!!!!!!!!!!!
  136. IMPORTANT:    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    
  137.  
  138.  
  139. SaferPatches IS compatible to the debug tool PatchWork.
  140.  
  141. _____________________________________________________________________________
  142.  
  143. Gurus:
  144.  
  145.     Because "SaferPatches" is supposed to be a debug utility, it may
  146. create "guru meditations", i.e. software alerts. The following alerts may
  147. be created by SaferPatches:
  148.  
  149. 0x01000020        Patch vector out of range.
  150.         A program tried to patch a vector in a library that isn't
  151.         present.
  152.  
  153. 0x01000021        Entry is not patchable.
  154.         A program tried to install a patch into a vector that can't
  155.         be patched. Some vectors, like the GetCC() vector of
  156.         the exec lib are directly inlined functions that can't be
  157.         changed with SaferPatches. Same goes for the DOS library
  158.         of releases 32 to 35, but this has changed starting with
  159.         releases 36 and up of the OS.
  160.  
  161. 0x010000022        No mem for patch vector.
  162.         SaferPatches failed to allocate a vector for the patch.
  163.  
  164. 0x010000023        Patched vector to ROM.
  165.         A program attempted to patch one ROM vector to a second
  166.         vector which is actually in the ROM. Replacing one system
  167.         function by a different one is considered to be illegal.
  168.  
  169. 0x010000024        Found libentry without patches
  170.         SaferPatches found a library in its patch list that isn't
  171.         actually patched. This is an internal failure and shouldn't
  172.         occure.
  173.  
  174. 0x010000025        Unsafe patch
  175.         A program tried to patch one vector that can't be patched in
  176.         a safe way because it is called by the SetFunction procedure
  177.         itself. One example is "SetFunction", or "SumLibrary".
  178.  
  179. _____________________________________________________________________________
  180.  
  181. Legal vs. illegal patching:
  182.  
  183. Three operations are considered to be "legal" patching operations:
  184.  
  185. 1)    Install a patch
  186. 2)    Remove a patch
  187. 3)    Verify, if a given patch is installed.
  188.  
  189. 3) is new to this implementation of SaferPatches and not having it messed the
  190. system with the RTPatch program.
  191.  
  192.  
  193. A legal way how to install a patch:
  194.  
  195.     -Call Forbid() or even Disable() in critical cases.
  196.     -Load the address of the new function in d0, the offset in a0,
  197.      the library and a1, and ExecBase in a6.
  198.     -Call SetFunction()
  199.     -Store the return value of SetFunction as pointer to the old function.
  200.     -Call Permit() or Disable().
  201.  
  202.  
  203. The following methods of installing patches ARE ILLEGAL:
  204.  
  205.     -Forgetting to Permit().
  206.     -Reading the vector directly from the library vectors instead of
  207.      using the return value.
  208.     -Using the return code of SetFunction for anything else except
  209.      jumping into the old code.
  210.     -Patching one OS function to a different one.
  211.     -Patching functions that can't be patched, like inline functions
  212.      or functions called by SaferPatches.
  213.     -Using anything else but the return code of SetFunction for calling
  214.      the old function.
  215.     -Writing the new function directly into the vector offset.
  216.  
  217.  
  218. A legal way to remove a patch:
  219.  
  220.     -Load d0 with the return code of SetFunction when installing the
  221.      patch. Load a1 with the base address of the library. Load a6
  222.      with execbase.
  223.     -Call SetFunction().
  224.  
  225. The following methods of removing a patch ARE ILLEGAL:
  226.  
  227.     -Use anything else but the return code of the installing SetFunction
  228.      for removing the patch again.
  229.     -Removing the new function by writing the old return code directly
  230.      into the vector offset.
  231.  
  232.  
  233. A legal way how to verify if your patch is still installed:
  234.  
  235.     -Call Forbid() or Disable()
  236.     -Call SetFunction with the same arguments AS IF you are installing
  237.      the patch again, this is:
  238.      Load the address of the new function in d0,the library base in a1
  239.      and ExecBase in a6 and offset in a0. Call SetFunction.
  240.     -Check the return code. If it is the same pointer you passed in d0
  241.      to SetFunction, your patch is still active. It has been installed
  242.      now and must/can be removed if it is anything else. 
  243.     -Call Permit() or Enable().
  244.  
  245. This method is used by the RTPatch program and also considered to be legal.
  246.  
  247. The following verify methods are considered to be illegal:
  248.  
  249.     -Failing to call Forbid().
  250.     -Reading the vector entry for the vector base directly.
  251.  
  252. _____________________________________________________________________________
  253.  
  254. Thomas,
  255.     August 1997
  256.  
  257.  
  258. ============================= Archive contents =============================
  259.  
  260. Original  Packed Ratio    Date     Time    Name
  261. -------- ------- ----- --------- --------  -------------
  262.     3072    2045 33.4% 21-Aug-97 21:17:38 +SaferPatches
  263.     8824    3457 60.8% 21-Aug-97 21:18:58 +SaferPatches.readme
  264.     4928    3300 33.0% 21-Aug-97 20:09:36 +ShowPatch
  265. -------- ------- ----- --------- --------
  266.    16824    8802 47.6% 23-Aug-97 01:41:46   3 files
  267.